package com.course.finalproject.ui;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.widget.ImageView;
import android.widget.TextView;

import com.course.finalproject.Constants;
import com.course.finalproject.R;
import com.course.finalproject.model.Weather;

public class WeatherItemActivity extends Activity {

	private TextView weekday;
	private TextView condition;
	private TextView cTemp;
	private TextView fTemp;
	private ImageView image;
	private TextView wind;
	private TextView humidity;
	
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// Super call.
		super.onCreate(savedInstanceState);
		// Set content view.
		setContentView(R.layout.weather_item_activity);
		Log.d(Constants.LOG_TAG, "WeatherItemActivity.OnCreate()");
		
		Bundle bundle = getIntent().getExtras();
		Weather weather = bundle.getParcelable(Constants.WEATHER_PARCEL_KEY);
		
		weekday = (TextView) findViewById(R.id.single_weather_weekday);
		weekday.setText( weather.getWeekDay() );
		
		condition = (TextView) findViewById(R.id.single_weather_condition);
		condition.setText( weather.getCondition() );

		image = (ImageView) findViewById(R.id.single_weather_image);
		image.setImageResource( weather.getIconResource() );
		
		cTemp = (TextView) findViewById(R.id.single_weather_temp);
		cTemp.setText( weather.getCelTempReadable() );
		
		fTemp = (TextView) findViewById(R.id.single_weather_fh_temp);
		fTemp.setText( weather.getFahTempReadable() );
		
		wind = (TextView) findViewById(R.id.single_weather_wind);
		wind.setText( weather.getWindReadable() );
		
		humidity = (TextView) findViewById(R.id.single_weather_humidity);
		humidity.setText( weather.getHumidityReadable() );
	}

}
